@extends('front.common.header')

@section('title', '找回密码')

@section('header')
    @parent
@stop
@section('content')
<link  rel="stylesheet" type="text/css" href="{{ asset('/css/common/report.css') }}" >
<div class="main">
    <div class="report-main">
        <div class="report-title">找回密码</div>
        <div>
            <div class="report-step @if($reset_type == 2) hide @endif" id="home-tab">
                <div class="report-step-step" id="step1_ti_cursor">
                    <img src="{{asset('/images/reset/reset_phone_1_on.png')}}">
                </div>
                <div class="report-step-step hide" id="step1_ti">
                    <img src="{{asset('/images/reset/reset_phone_1.png')}}">
                </div>
                <div class="report-step-step margin-left-020" id="step2_ti">
                    <img src="{{asset('/images/reset/reset_phone_2.png')}}">
                </div>
                <div class="report-step-step hide margin-left-020" id="step2_ti_cursor">
                    <img src="{{asset('/images/reset/reset_phone_2_on.png')}}">
                </div>
            </div>
            <div class="report-step @if($reset_type == 1) hide @endif" id="profile-tab">
                <div class="report-step-step @if(session('status')) hide @endif" id="p_step1_ti_cursor">
                    <img src="{{asset('/images/reset/reset_email_1_on.png')}}">
                </div>
                <div class="report-step-step @if(!session('status')) hide @endif" id="p_step1_ti">
                    <img src="{{asset('/images/reset/reset_email_1.png')}}">
                </div>
                <div class="report-step-step margin-left-020 @if(session('status')) hide @endif" id="p_step2_ti">
                    <img src="{{asset('/images/reset/reset_email_2.png')}}">
                </div>
                <div class="report-step-step margin-left-020 @if(!session('status')) hide @endif" id="p_step2_ti_cursor">
                    <img src="{{asset('/images/reset/reset_email_2_on.png')}}">
                </div>
                <div class="report-step-step margin-left-020" id="p_step2_ti">
                    <img src="{{asset('/images/reset/reset_email_3.png')}}">
                </div>
                <div class="report-step-step hide margin-left-020" id="p_step2_ti_cursor">
                    <img src="{{asset('/images/reset/reset_email_3_on.png')}}">
                    <div class="step-number-3-cursor">3</div>
                </div>
            </div>
        </div>
        <div class="clearfix mt-20 padd-l-15">
            <ul class="nav nav-tabs" role="tablist">
                <li class="@if($reset_type == 1 ) active @endif"><a href="{{url('/password/email?reset_type=1')}}">通过手机找回</a></li>
                <li class="@if($reset_type == 2 ) active @endif"><a href="{{url('/password/email?reset_type=2')}}">通过邮箱找回</a></li>
            </ul>
        </div>
        <div class="tab-content">
			@if (count($errors) > 0)
				<div class="alert alert-danger mt-20">
					<ul>
						@foreach ($errors->all() as $error)
							<li>{{ $error }}</li>
						@endforeach
					</ul>
				</div>
			@endif
            <div role="tabpanel" class="report-content tab-pane @if($reset_type == 2) active @endif" id="profile">
                <div class="report-content @if(session('status')) hide @endif" id="p_step1">
                    <form id="checkEmailForm" method="post" action="{{ url('/password/email') }}">
                        <div  class="report-info-inline" style="padding-top: 40px;">
                            <div class="form-group">
                                <input type="email" name="email" class="form-control" value="{{old('email')}}" placeholder="请输入注册时使用的邮箱">
                            </div>
                            {!! csrf_field() !!}
                            <div class="form-group">
                                <button class="btn btn-reset-btn" type="submit" >
                                    找回密码
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="report-content @if(!session('status')) hide @endif" id="p_step2">
                    <div  class="report-info-inline" style="padding-top: 40px;">
                        <p class="send-email-success">
                            密码重置邮件已发送至邮箱：
                        </p>
                        <p class="send-emailer">{{ old('email') }}</p>
                        <p class="help-block">请在24小时内登录您的邮箱接受邮件，链接激活后可重置密码。</p>
                        <div class="form-group mt-20">
                            <button class="btn btn-reset-btn" type="button" onclick="location.href='{{session('mailAddress')}}'">
                                登录邮箱查看
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div role="tabpanel" class="report-content tab-pane @if($reset_type == 1) active @endif" id="home">
                <div class="report-content" id="step1">
                    <form id="checkPhoneForm" method="post" action="{{url('/password/check')}}">
                        <div  class="report-info-inline">
                            <div class="form-group">
                                <input type="number" name="username" class="form-control" value="{{old('username')}}" placeholder="请输入注册时使用的手机号码">
                            </div>
                            <div class="form-group clearfix">
                                <div class="float-l width-50">
                                    <input type="text" name="verify_code" class="form-control" placeholder="我不是机器人">
                                </div>
                                <div class="float-r width-50">
                                    <img src="{{ url('captcha') }}" height="40" width="100%" onclick="this.src='{{ url('captcha') }}?r='+Math.random();" alt="">
                                </div>
                            </div>
                            <div class="form-group clearfix">
                                <div class="float-l width-50">
                                    <input type="number" name="phone_code" class="form-control" placeholder="请输入验证码">
                                </div>
                                <div class="float-r width-50">
                                    <button class="float-r curl-code selected" type="button"  id="to_verify_reset" onclick="resetverify('checkPhoneForm')">
                                        <span class="color-3 hide font-16" id="reset_counter">60s</span>
                                        <span id="reset_counter_cnt">获取验证码</span>
                                    </button>
                                </div>
                            </div>
                            <input type="hidden" name="type" value="1">
                            {!! csrf_field() !!}
                            <div class="form-group">
                                <button class="btn btn-reset-btn" type="submit">
                                    找回密码
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@stop

<!-- 底部块 -->
@section('footer')
    @parent
@stop